import java.util.Arrays;
import java.util.Scanner;

public class shuzu {
    public static void main(String[] args) {
        //数组 类型一致 长度有限
        //数据类型[] 数组名；
        //数据类型 数组名[];(X)
        //手机[] 手机袋;
        //手机袋 = new 手机[42];
        //手机袋[14] = 张三的Iphone;
        int[] socres;
        socres = new int[5];
        Scanner sc = new Scanner(System.in);
        //对索引进行循环
        for (int i = 0;i<socres.length;i++){
            int ss = sc.nextInt();
            socres[i] = ss;
        }
        Arrays.sort(socres);
        for (int i = 0;i < socres.length;i++){
            System.out.println(socres[i]);
        }
        System.out.println("反向输出");
        //反向输出
        for (int i = socres.length-1;i>=0;i--){
            System.out.println(socres[i]);
        }
        //求和
//        int sum = 0;
//        for (int i =0;i < socres.length;i++){
//            sum = sum+socres[i];
//        }
//        //求平均值
//        int avg = sum/socres.length;
//        System.out.println(avg);
        //数组赋值
        //数组名[索引] = 值;
//        socres[0] = 100;
//        socres[1] = 90;
//        socres[5] = 40;
//        float[] ff = new float[10];
//        char[] cc = new char[3];
//        boolean[] bb = new boolean[4];
//        System.out.println(bb[2]);
        //基本数据类型默认值
        //数字类型 0
        //char ''
        //boolean false
    }
}
